/* 	TagCloud
 *	tag control
 */



var TagCloud = function( action, vars, modid )	{
	
	
	Object.extend( obj = xhttp.checkscope( '.TagCloud' ), TagCloud.proto );
	Object.extend( obj, TagCloud[ "proto_" + action ]);
	
	obj.modid		= modid;
	obj.vars 		= vars;
	
	return obj.init( vars );
	
}

// GENERAL PROTOS
TagCloud.proto = {
	mail		: function() {
		
		console.log( "mail." );
	}

}

TagCloud.proto_childSelect = {

	init			: function( vars ) {
		
		this.down( "select" ).observe( "change", this.push.bind( this ) )
				
		return this;
	},
	
		
	push			: function() {
		
		this.vars.selected = this.down( "select" ).getValue();
		//xhttp.construct({ id: this.modid, vars: this.vars }, this, true );
		xhttp.send( '/xhttp.mod', { mod: "tag.cloud", action: "childSelect", vars: this.vars }, this.pull_response.bind( this ));
		
		
		
		//this.vars.am = Number( this.down( "#name" ).value );
		//
	},
	
	pull_response			: function( response ) {
		
		set = response.responseText.evalJSON();
		
		console.log( set );
	}
}